package com.itheima.tlias84;

import com.itheima.tlias84.entity.Teacher;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class Tlias84Application {

    public static void main(String[] args) {
        SpringApplication.run(Tlias84Application.class, args);
    }

    /**
     * 原本由Compoent注解的bean对象是单例模式，自定义多个bean对象时，选择默认为方法名

     * 一般用于自动配置第三方对象的连接信息 ， 例如  阿里云oss对象
     * @return
     */
    @Bean("张三")
    public Teacher createTeacherOne(){
        return new Teacher("张三",18);
    }

    @Bean("里斯")
    public Teacher createTeacherTwo(){
        return new Teacher("里斯",18);
    }

}
